home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #11 / Amiga Plus CD - 2004 - No. 11.iso / AmiSoft / Dev / misc / LOCCounter.lha / LOCCounter / src / Makefile < prev    next >
Makefile  |  2004-08-17  |  2KB  |  80 lines

  1. #############################################################################
  2. #
  3. # $RCSfile: Makefile $
  4. # $Revision: 1.12 $
  5. # $Date: 2004/08/17 23:06:48 $
  6. # $Author: ssolie $
  7. #
  8. #############################################################################
  9. #
  10. # Copyright (c) 2004 Steven Solie.  All Rights Reserved.
  11. #
  12. #############################################################################
  13. .PHONY : all clean list count release
  14.  
  15. CXX         := g++
  16. CXXFLAGS    := -Wall -ftemplate-depth-30 -ISDK:boost -DBOOST_DISABLE_ASSERTS
  17. LD          := g++
  18. LDFLAGS     :=
  19.  
  20. EXENAME     := loc
  21. OBJECTS     := Main.o ArgParser.o FileCount.o Tally.o FileTally.o\
  22.     SourceCode.o PatternMatch.o File.o
  23. LIBS        :=
  24.  
  25.  
  26. ### All targets ###
  27. all release: $(EXENAME)
  28.     @List $(EXENAME) NOHEAD
  29.     @Echo "Executable is ready. Go ahead and run it. I dare you."
  30.  
  31.  
  32. ### Adjust flags based on target ###
  33. ifeq ($(MAKECMDGOALS), release)
  34.  CXXFLAGS += -O3
  35. endif
  36.  
  37.  
  38. ### Executable program creation ###
  39. $(EXENAME): $(OBJECTS)
  40.     @Echo "Linking $@..."
  41.     @$(LD) $(LDFLAGS) -o $@ $(OBJECTS) $(LIBS)
  42.     @strip -R.comment $@
  43.  
  44.  
  45. ### Pattern Rules ###
  46. %.o: %.cpp
  47.     @Echo Compiling $<...
  48.     @$(CXX) $(CXXFLAGS) -c $<
  49.  
  50.  
  51. ### Source file dependencies ###
  52. Main.o: Main.cpp Main.h ArgParser.h FileCount.h SourceCode.h Tally.h\
  53.     PatternMatch.h
  54.  
  55. ArgParser.o: ArgParser.cpp ArgParser.h
  56.  
  57. SourceCode.o: SourceCode.cpp SourceCode.h FileCount.h File.h
  58.  
  59. Tally.o: Tally.cpp Tally.h FileCount.h FileTally.h
  60.  
  61. FileTally.o: FileTally.cpp FileTally.h
  62.  
  63. FileCount.o: FileCount.cpp FileCount.h
  64.  
  65. PatternMatch.o: PatternMatch.cpp PatternMatch.h
  66.  
  67. File.o: File.cpp File.h
  68.  
  69.  
  70. ### Other targets ###
  71. clean:
  72.     @-Delete >NIL: "#?.(o|obj)" QUIET FORCE
  73.  
  74. list:
  75.     @List #?.(h|cpp) Makefile NOHEAD SORT=RD
  76.  
  77. count:
  78.     @loc #?.(h|cpp) TOTAL
  79.     @-loc #?.diff DIFF TOTAL
  80.